# Generated from HelloSyntax.g4 by ANTLR 4.9.2
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3#")
        buf.write("\u0081\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\3\2\6\2\32")
        buf.write("\n\2\r\2\16\2\33\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3\3")
        buf.write("\3\3\3\5\3)\n\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3")
        buf.write("\4\6\4\65\n\4\r\4\16\4\66\3\4\3\4\3\5\3\5\3\5\3\5\3\5")
        buf.write("\3\5\6\5A\n\5\r\5\16\5B\3\5\3\5\3\5\3\5\6\5I\n\5\r\5\16")
        buf.write("\5J\3\5\3\5\5\5O\n\5\3\6\3\6\3\6\3\6\5\6U\n\6\3\7\3\7")
        buf.write("\3\7\3\7\3\b\3\b\3\b\7\b^\n\b\f\b\16\ba\13\b\3\t\3\t\3")
        buf.write("\t\5\tf\n\t\3\n\3\n\3\n\7\nk\n\n\f\n\16\nn\13\n\3\13\3")
        buf.write("\13\3\13\7\13s\n\13\f\13\16\13v\13\13\3\f\3\f\3\f\3\f")
        buf.write("\3\f\3\f\3\f\5\f\177\n\f\3\f\2\2\r\2\4\6\b\n\f\16\20\22")
        buf.write("\24\26\2\6\3\2\16\17\3\2\26\32\3\2\22\23\3\2\24\25\2\u0086")
        buf.write("\2\31\3\2\2\2\4(\3\2\2\2\6*\3\2\2\2\b:\3\2\2\2\nP\3\2")
        buf.write("\2\2\fV\3\2\2\2\16Z\3\2\2\2\20b\3\2\2\2\22g\3\2\2\2\24")
        buf.write("o\3\2\2\2\26~\3\2\2\2\30\32\5\4\3\2\31\30\3\2\2\2\32\33")
        buf.write("\3\2\2\2\33\31\3\2\2\2\33\34\3\2\2\2\34\3\3\2\2\2\35)")
        buf.write("\5\6\4\2\36)\5\b\5\2\37 \5\n\6\2 !\7\33\2\2!)\3\2\2\2")
        buf.write("\"#\5\f\7\2#$\7\33\2\2$)\3\2\2\2%&\5\16\b\2&\'\7\33\2")
        buf.write("\2\')\3\2\2\2(\35\3\2\2\2(\36\3\2\2\2(\37\3\2\2\2(\"\3")
        buf.write("\2\2\2(%\3\2\2\2)\5\3\2\2\2*+\7\t\2\2+,\7\34\2\2,-\5\n")
        buf.write("\6\2-.\7\33\2\2./\5\16\b\2/\60\7\33\2\2\60\61\5\f\7\2")
        buf.write("\61\62\7\35\2\2\62\64\7\36\2\2\63\65\5\4\3\2\64\63\3\2")
        buf.write("\2\2\65\66\3\2\2\2\66\64\3\2\2\2\66\67\3\2\2\2\678\3\2")
        buf.write("\2\289\7\37\2\29\7\3\2\2\2:;\7\6\2\2;<\7\34\2\2<=\5\16")
        buf.write("\b\2=>\7\35\2\2>@\7\36\2\2?A\5\4\3\2@?\3\2\2\2AB\3\2\2")
        buf.write("\2B@\3\2\2\2BC\3\2\2\2CD\3\2\2\2DN\7\37\2\2EF\7\7\2\2")
        buf.write("FH\7\36\2\2GI\5\4\3\2HG\3\2\2\2IJ\3\2\2\2JH\3\2\2\2JK")
        buf.write("\3\2\2\2KL\3\2\2\2LM\7\37\2\2MO\3\2\2\2NE\3\2\2\2NO\3")
        buf.write("\2\2\2O\t\3\2\2\2PQ\7\3\2\2QT\7 \2\2RS\7!\2\2SU\5\16\b")
        buf.write("\2TR\3\2\2\2TU\3\2\2\2U\13\3\2\2\2VW\7 \2\2WX\7!\2\2X")
        buf.write("Y\5\16\b\2Y\r\3\2\2\2Z_\5\20\t\2[\\\t\2\2\2\\^\5\20\t")
        buf.write("\2][\3\2\2\2^a\3\2\2\2_]\3\2\2\2_`\3\2\2\2`\17\3\2\2\2")
        buf.write("a_\3\2\2\2be\5\22\n\2cd\t\3\2\2df\5\22\n\2ec\3\2\2\2e")
        buf.write("f\3\2\2\2f\21\3\2\2\2gl\5\24\13\2hi\t\4\2\2ik\5\24\13")
        buf.write("\2jh\3\2\2\2kn\3\2\2\2lj\3\2\2\2lm\3\2\2\2m\23\3\2\2\2")
        buf.write("nl\3\2\2\2ot\5\26\f\2pq\t\5\2\2qs\5\26\f\2rp\3\2\2\2s")
        buf.write("v\3\2\2\2tr\3\2\2\2tu\3\2\2\2u\25\3\2\2\2vt\3\2\2\2w\177")
        buf.write("\7 \2\2x\177\7\20\2\2y\177\7\21\2\2z{\7\34\2\2{|\5\16")
        buf.write("\b\2|}\7\35\2\2}\177\3\2\2\2~w\3\2\2\2~x\3\2\2\2~y\3\2")
        buf.write("\2\2~z\3\2\2\2\177\27\3\2\2\2\16\33(\66BJNT_elt~")
        return buf.getvalue()


class HelloSyntaxParser ( Parser ):

    grammarFileName = "HelloSyntax.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'int'", "'string'", "'bool'", "'if'", 
                     "'else'", "'while'", "'for'", "'break'", "'continue'", 
                     "'true'", "'false'", "'and'", "'or'", "<INVALID>", 
                     "<INVALID>", "'+'", "'-'", "'*'", "'/'", "'>'", "'<'", 
                     "'=='", "'>='", "'<='", "';'", "'('", "')'", "'{'", 
                     "'}'", "<INVALID>", "'='" ]

    symbolicNames = [ "<INVALID>", "Int", "String", "Bool", "If", "Else", 
                      "While", "For", "Break", "Continue", "BTrue", "BFalse", 
                      "And", "Or", "IntLiteral", "StringLiteral", "Plus", 
                      "Minus", "Star", "Slash", "GT", "LT", "EQ", "GE", 
                      "LE", "Semicolon", "LPAREN", "RPAREN", "LBRACE", "RBRACE", 
                      "Identifier", "Assignment", "WhiteSpace", "NewLine" ]

    RULE_program = 0
    RULE_expressionStmt = 1
    RULE_forLoopStmt = 2
    RULE_ifStmt = 3
    RULE_intDeclaration = 4
    RULE_assignmentExpression = 5
    RULE_boolExpression = 6
    RULE_comparision = 7
    RULE_additiveEx = 8
    RULE_multiplicativeEX = 9
    RULE_primary = 10

    ruleNames =  [ "program", "expressionStmt", "forLoopStmt", "ifStmt", 
                   "intDeclaration", "assignmentExpression", "boolExpression", 
                   "comparision", "additiveEx", "multiplicativeEX", "primary" ]

    EOF = Token.EOF
    Int=1
    String=2
    Bool=3
    If=4
    Else=5
    While=6
    For=7
    Break=8
    Continue=9
    BTrue=10
    BFalse=11
    And=12
    Or=13
    IntLiteral=14
    StringLiteral=15
    Plus=16
    Minus=17
    Star=18
    Slash=19
    GT=20
    LT=21
    EQ=22
    GE=23
    LE=24
    Semicolon=25
    LPAREN=26
    RPAREN=27
    LBRACE=28
    RBRACE=29
    Identifier=30
    Assignment=31
    WhiteSpace=32
    NewLine=33

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.9.2")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None




    class ProgramContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def expressionStmt(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.ExpressionStmtContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.ExpressionStmtContext,i)


        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_program

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterProgram" ):
                listener.enterProgram(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitProgram" ):
                listener.exitProgram(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitProgram" ):
                return visitor.visitProgram(self)
            else:
                return visitor.visitChildren(self)




    def program(self):

        localctx = HelloSyntaxParser.ProgramContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_program)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 23 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 22
                self.expressionStmt()
                self.state = 25 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << HelloSyntaxParser.Int) | (1 << HelloSyntaxParser.If) | (1 << HelloSyntaxParser.For) | (1 << HelloSyntaxParser.IntLiteral) | (1 << HelloSyntaxParser.StringLiteral) | (1 << HelloSyntaxParser.LPAREN) | (1 << HelloSyntaxParser.Identifier))) != 0)):
                    break

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ExpressionStmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def forLoopStmt(self):
            return self.getTypedRuleContext(HelloSyntaxParser.ForLoopStmtContext,0)


        def ifStmt(self):
            return self.getTypedRuleContext(HelloSyntaxParser.IfStmtContext,0)


        def intDeclaration(self):
            return self.getTypedRuleContext(HelloSyntaxParser.IntDeclarationContext,0)


        def Semicolon(self):
            return self.getToken(HelloSyntaxParser.Semicolon, 0)

        def assignmentExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.AssignmentExpressionContext,0)


        def boolExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.BoolExpressionContext,0)


        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_expressionStmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterExpressionStmt" ):
                listener.enterExpressionStmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitExpressionStmt" ):
                listener.exitExpressionStmt(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitExpressionStmt" ):
                return visitor.visitExpressionStmt(self)
            else:
                return visitor.visitChildren(self)




    def expressionStmt(self):

        localctx = HelloSyntaxParser.ExpressionStmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_expressionStmt)
        try:
            self.state = 38
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,1,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 27
                self.forLoopStmt()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 28
                self.ifStmt()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 29
                self.intDeclaration()
                self.state = 30
                self.match(HelloSyntaxParser.Semicolon)
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 32
                self.assignmentExpression()
                self.state = 33
                self.match(HelloSyntaxParser.Semicolon)
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 35
                self.boolExpression()
                self.state = 36
                self.match(HelloSyntaxParser.Semicolon)
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ForLoopStmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def For(self):
            return self.getToken(HelloSyntaxParser.For, 0)

        def LPAREN(self):
            return self.getToken(HelloSyntaxParser.LPAREN, 0)

        def intDeclaration(self):
            return self.getTypedRuleContext(HelloSyntaxParser.IntDeclarationContext,0)


        def Semicolon(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.Semicolon)
            else:
                return self.getToken(HelloSyntaxParser.Semicolon, i)

        def boolExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.BoolExpressionContext,0)


        def assignmentExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.AssignmentExpressionContext,0)


        def RPAREN(self):
            return self.getToken(HelloSyntaxParser.RPAREN, 0)

        def LBRACE(self):
            return self.getToken(HelloSyntaxParser.LBRACE, 0)

        def RBRACE(self):
            return self.getToken(HelloSyntaxParser.RBRACE, 0)

        def expressionStmt(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.ExpressionStmtContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.ExpressionStmtContext,i)


        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_forLoopStmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterForLoopStmt" ):
                listener.enterForLoopStmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitForLoopStmt" ):
                listener.exitForLoopStmt(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitForLoopStmt" ):
                return visitor.visitForLoopStmt(self)
            else:
                return visitor.visitChildren(self)




    def forLoopStmt(self):

        localctx = HelloSyntaxParser.ForLoopStmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_forLoopStmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 40
            self.match(HelloSyntaxParser.For)
            self.state = 41
            self.match(HelloSyntaxParser.LPAREN)
            self.state = 42
            self.intDeclaration()
            self.state = 43
            self.match(HelloSyntaxParser.Semicolon)
            self.state = 44
            self.boolExpression()
            self.state = 45
            self.match(HelloSyntaxParser.Semicolon)
            self.state = 46
            self.assignmentExpression()
            self.state = 47
            self.match(HelloSyntaxParser.RPAREN)
            self.state = 48
            self.match(HelloSyntaxParser.LBRACE)
            self.state = 50 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 49
                self.expressionStmt()
                self.state = 52 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << HelloSyntaxParser.Int) | (1 << HelloSyntaxParser.If) | (1 << HelloSyntaxParser.For) | (1 << HelloSyntaxParser.IntLiteral) | (1 << HelloSyntaxParser.StringLiteral) | (1 << HelloSyntaxParser.LPAREN) | (1 << HelloSyntaxParser.Identifier))) != 0)):
                    break

            self.state = 54
            self.match(HelloSyntaxParser.RBRACE)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IfStmtContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser
            self.success = None # ExpressionStmtContext
            self.faild = None # ExpressionStmtContext

        def If(self):
            return self.getToken(HelloSyntaxParser.If, 0)

        def LPAREN(self):
            return self.getToken(HelloSyntaxParser.LPAREN, 0)

        def boolExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.BoolExpressionContext,0)


        def RPAREN(self):
            return self.getToken(HelloSyntaxParser.RPAREN, 0)

        def LBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.LBRACE)
            else:
                return self.getToken(HelloSyntaxParser.LBRACE, i)

        def RBRACE(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.RBRACE)
            else:
                return self.getToken(HelloSyntaxParser.RBRACE, i)

        def Else(self):
            return self.getToken(HelloSyntaxParser.Else, 0)

        def expressionStmt(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.ExpressionStmtContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.ExpressionStmtContext,i)


        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_ifStmt

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIfStmt" ):
                listener.enterIfStmt(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIfStmt" ):
                listener.exitIfStmt(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitIfStmt" ):
                return visitor.visitIfStmt(self)
            else:
                return visitor.visitChildren(self)




    def ifStmt(self):

        localctx = HelloSyntaxParser.IfStmtContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_ifStmt)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 56
            self.match(HelloSyntaxParser.If)
            self.state = 57
            self.match(HelloSyntaxParser.LPAREN)
            self.state = 58
            self.boolExpression()
            self.state = 59
            self.match(HelloSyntaxParser.RPAREN)
            self.state = 60
            self.match(HelloSyntaxParser.LBRACE)
            self.state = 62 
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while True:
                self.state = 61
                localctx.success = self.expressionStmt()
                self.state = 64 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << HelloSyntaxParser.Int) | (1 << HelloSyntaxParser.If) | (1 << HelloSyntaxParser.For) | (1 << HelloSyntaxParser.IntLiteral) | (1 << HelloSyntaxParser.StringLiteral) | (1 << HelloSyntaxParser.LPAREN) | (1 << HelloSyntaxParser.Identifier))) != 0)):
                    break

            self.state = 66
            self.match(HelloSyntaxParser.RBRACE)
            self.state = 76
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==HelloSyntaxParser.Else:
                self.state = 67
                self.match(HelloSyntaxParser.Else)
                self.state = 68
                self.match(HelloSyntaxParser.LBRACE)
                self.state = 70 
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while True:
                    self.state = 69
                    localctx.faild = self.expressionStmt()
                    self.state = 72 
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)
                    if not ((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << HelloSyntaxParser.Int) | (1 << HelloSyntaxParser.If) | (1 << HelloSyntaxParser.For) | (1 << HelloSyntaxParser.IntLiteral) | (1 << HelloSyntaxParser.StringLiteral) | (1 << HelloSyntaxParser.LPAREN) | (1 << HelloSyntaxParser.Identifier))) != 0)):
                        break

                self.state = 74
                self.match(HelloSyntaxParser.RBRACE)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class IntDeclarationContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Int(self):
            return self.getToken(HelloSyntaxParser.Int, 0)

        def Identifier(self):
            return self.getToken(HelloSyntaxParser.Identifier, 0)

        def Assignment(self):
            return self.getToken(HelloSyntaxParser.Assignment, 0)

        def boolExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.BoolExpressionContext,0)


        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_intDeclaration

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterIntDeclaration" ):
                listener.enterIntDeclaration(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitIntDeclaration" ):
                listener.exitIntDeclaration(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitIntDeclaration" ):
                return visitor.visitIntDeclaration(self)
            else:
                return visitor.visitChildren(self)




    def intDeclaration(self):

        localctx = HelloSyntaxParser.IntDeclarationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_intDeclaration)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 78
            self.match(HelloSyntaxParser.Int)
            self.state = 79
            self.match(HelloSyntaxParser.Identifier)
            self.state = 82
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==HelloSyntaxParser.Assignment:
                self.state = 80
                self.match(HelloSyntaxParser.Assignment)
                self.state = 81
                self.boolExpression()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AssignmentExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Identifier(self):
            return self.getToken(HelloSyntaxParser.Identifier, 0)

        def Assignment(self):
            return self.getToken(HelloSyntaxParser.Assignment, 0)

        def boolExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.BoolExpressionContext,0)


        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_assignmentExpression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAssignmentExpression" ):
                listener.enterAssignmentExpression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAssignmentExpression" ):
                listener.exitAssignmentExpression(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitAssignmentExpression" ):
                return visitor.visitAssignmentExpression(self)
            else:
                return visitor.visitChildren(self)




    def assignmentExpression(self):

        localctx = HelloSyntaxParser.AssignmentExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_assignmentExpression)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 84
            self.match(HelloSyntaxParser.Identifier)
            self.state = 85
            self.match(HelloSyntaxParser.Assignment)
            self.state = 86
            self.boolExpression()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class BoolExpressionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def comparision(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.ComparisionContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.ComparisionContext,i)


        def And(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.And)
            else:
                return self.getToken(HelloSyntaxParser.And, i)

        def Or(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.Or)
            else:
                return self.getToken(HelloSyntaxParser.Or, i)

        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_boolExpression

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterBoolExpression" ):
                listener.enterBoolExpression(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitBoolExpression" ):
                listener.exitBoolExpression(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitBoolExpression" ):
                return visitor.visitBoolExpression(self)
            else:
                return visitor.visitChildren(self)




    def boolExpression(self):

        localctx = HelloSyntaxParser.BoolExpressionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_boolExpression)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 88
            self.comparision()
            self.state = 93
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==HelloSyntaxParser.And or _la==HelloSyntaxParser.Or:
                self.state = 89
                _la = self._input.LA(1)
                if not(_la==HelloSyntaxParser.And or _la==HelloSyntaxParser.Or):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 90
                self.comparision()
                self.state = 95
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ComparisionContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def additiveEx(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.AdditiveExContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.AdditiveExContext,i)


        def GT(self):
            return self.getToken(HelloSyntaxParser.GT, 0)

        def LT(self):
            return self.getToken(HelloSyntaxParser.LT, 0)

        def EQ(self):
            return self.getToken(HelloSyntaxParser.EQ, 0)

        def GE(self):
            return self.getToken(HelloSyntaxParser.GE, 0)

        def LE(self):
            return self.getToken(HelloSyntaxParser.LE, 0)

        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_comparision

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterComparision" ):
                listener.enterComparision(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitComparision" ):
                listener.exitComparision(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitComparision" ):
                return visitor.visitComparision(self)
            else:
                return visitor.visitChildren(self)




    def comparision(self):

        localctx = HelloSyntaxParser.ComparisionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_comparision)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 96
            self.additiveEx()
            self.state = 99
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if (((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << HelloSyntaxParser.GT) | (1 << HelloSyntaxParser.LT) | (1 << HelloSyntaxParser.EQ) | (1 << HelloSyntaxParser.GE) | (1 << HelloSyntaxParser.LE))) != 0):
                self.state = 97
                _la = self._input.LA(1)
                if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << HelloSyntaxParser.GT) | (1 << HelloSyntaxParser.LT) | (1 << HelloSyntaxParser.EQ) | (1 << HelloSyntaxParser.GE) | (1 << HelloSyntaxParser.LE))) != 0)):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 98
                self.additiveEx()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AdditiveExContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def multiplicativeEX(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.MultiplicativeEXContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.MultiplicativeEXContext,i)


        def Plus(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.Plus)
            else:
                return self.getToken(HelloSyntaxParser.Plus, i)

        def Minus(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.Minus)
            else:
                return self.getToken(HelloSyntaxParser.Minus, i)

        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_additiveEx

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterAdditiveEx" ):
                listener.enterAdditiveEx(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitAdditiveEx" ):
                listener.exitAdditiveEx(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitAdditiveEx" ):
                return visitor.visitAdditiveEx(self)
            else:
                return visitor.visitChildren(self)




    def additiveEx(self):

        localctx = HelloSyntaxParser.AdditiveExContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_additiveEx)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 101
            self.multiplicativeEX()
            self.state = 106
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==HelloSyntaxParser.Plus or _la==HelloSyntaxParser.Minus:
                self.state = 102
                _la = self._input.LA(1)
                if not(_la==HelloSyntaxParser.Plus or _la==HelloSyntaxParser.Minus):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 103
                self.multiplicativeEX()
                self.state = 108
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class MultiplicativeEXContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def primary(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(HelloSyntaxParser.PrimaryContext)
            else:
                return self.getTypedRuleContext(HelloSyntaxParser.PrimaryContext,i)


        def Star(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.Star)
            else:
                return self.getToken(HelloSyntaxParser.Star, i)

        def Slash(self, i:int=None):
            if i is None:
                return self.getTokens(HelloSyntaxParser.Slash)
            else:
                return self.getToken(HelloSyntaxParser.Slash, i)

        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_multiplicativeEX

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterMultiplicativeEX" ):
                listener.enterMultiplicativeEX(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitMultiplicativeEX" ):
                listener.exitMultiplicativeEX(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitMultiplicativeEX" ):
                return visitor.visitMultiplicativeEX(self)
            else:
                return visitor.visitChildren(self)




    def multiplicativeEX(self):

        localctx = HelloSyntaxParser.MultiplicativeEXContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_multiplicativeEX)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 109
            self.primary()
            self.state = 114
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==HelloSyntaxParser.Star or _la==HelloSyntaxParser.Slash:
                self.state = 110
                _la = self._input.LA(1)
                if not(_la==HelloSyntaxParser.Star or _la==HelloSyntaxParser.Slash):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()
                self.state = 111
                self.primary()
                self.state = 116
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class PrimaryContext(ParserRuleContext):
        __slots__ = 'parser'

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def Identifier(self):
            return self.getToken(HelloSyntaxParser.Identifier, 0)

        def IntLiteral(self):
            return self.getToken(HelloSyntaxParser.IntLiteral, 0)

        def StringLiteral(self):
            return self.getToken(HelloSyntaxParser.StringLiteral, 0)

        def LPAREN(self):
            return self.getToken(HelloSyntaxParser.LPAREN, 0)

        def boolExpression(self):
            return self.getTypedRuleContext(HelloSyntaxParser.BoolExpressionContext,0)


        def RPAREN(self):
            return self.getToken(HelloSyntaxParser.RPAREN, 0)

        def getRuleIndex(self):
            return HelloSyntaxParser.RULE_primary

        def enterRule(self, listener:ParseTreeListener):
            if hasattr( listener, "enterPrimary" ):
                listener.enterPrimary(self)

        def exitRule(self, listener:ParseTreeListener):
            if hasattr( listener, "exitPrimary" ):
                listener.exitPrimary(self)

        def accept(self, visitor:ParseTreeVisitor):
            if hasattr( visitor, "visitPrimary" ):
                return visitor.visitPrimary(self)
            else:
                return visitor.visitChildren(self)




    def primary(self):

        localctx = HelloSyntaxParser.PrimaryContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_primary)
        try:
            self.state = 124
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [HelloSyntaxParser.Identifier]:
                self.enterOuterAlt(localctx, 1)
                self.state = 117
                self.match(HelloSyntaxParser.Identifier)
                pass
            elif token in [HelloSyntaxParser.IntLiteral]:
                self.enterOuterAlt(localctx, 2)
                self.state = 118
                self.match(HelloSyntaxParser.IntLiteral)
                pass
            elif token in [HelloSyntaxParser.StringLiteral]:
                self.enterOuterAlt(localctx, 3)
                self.state = 119
                self.match(HelloSyntaxParser.StringLiteral)
                pass
            elif token in [HelloSyntaxParser.LPAREN]:
                self.enterOuterAlt(localctx, 4)
                self.state = 120
                self.match(HelloSyntaxParser.LPAREN)
                self.state = 121
                self.boolExpression()
                self.state = 122
                self.match(HelloSyntaxParser.RPAREN)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





